﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace ColorPickerDemo
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                lblColor.Text = this.ColorPicker1.Color;
                lblColor.Style.Add(HtmlTextWriterStyle.Color, this.ColorPicker1.Color);

                Label1.Text = this.ColorPicker2.Color;
                Label1.Style.Add(HtmlTextWriterStyle.Color, this.ColorPicker2.Color);
            }
        }

        public void ColorPicker1_ColorChanged(object sender, EventArgs e)
        {
            lblColor.Text = this.ColorPicker1.Color;
            lblColor.Style.Add(HtmlTextWriterStyle.Color, this.ColorPicker1.Color);

            Label1.Text = this.ColorPicker2.Color;
            Label1.Style.Add(HtmlTextWriterStyle.Color, this.ColorPicker2.Color);
        }

         public void ColorPicker2_ColorChanged(object sender, EventArgs e)
        {
            lblColor.Text = this.ColorPicker1.Color;
            lblColor.Style.Add(HtmlTextWriterStyle.Color, this.ColorPicker1.Color);

            Label1.Text = this.ColorPicker2.Color;
            Label1.Style.Add(HtmlTextWriterStyle.Color, this.ColorPicker2.Color);
        }
    }
}
